<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:s="http://jboss.com/products/seam/taglib">
<body>
    <ui:composition template="/WEB-INF/template.xhtml">
        <ui:define name="topnav">
            <ui:include src="/WEB-INF/incl/admin_nav.xhtml" />
        </ui:define>

        <ui:define name="sidebar">
            <ui:include src="/WEB-INF/incl/login.xhtml" />
            <ui:include src="/WEB-INF/incl/stats.xhtml" />
            <ui:include src="/WEB-INF/incl/processmenu.xhtml" />
        </ui:define>
        
        <ui:define name="body">
            <h1>Order Shipping</h1>

            <p>Please enter the tracking number below.</p>

            <div class="cntInfo">
                <h:form id="ShippingForm">
                    <h:panelGrid id="ShippingDetailPanel" columns="2">
                        <h:outputText id="OrderIdText" value="Order Number:" />
                        <h:outputText id="OrderIdValue" value="#{order.orderId}" />
                        
                        <h:outputText id="OrderDateText" value="Order date:" />
                        <h:outputText id="OrderDateValue" value="#{order.orderDate}">
                            <s:convertDateTime type="both" dateStyle="full"/> 
                        </h:outputText>
                        
                        <h:outputText id="NetAmountText" value="Net Amount:" />
                        <h:outputText id="NetAmountValue" value="#{order.netAmount}">
                            <f:convertNumber type="currency" currencySymbol="$" />
                        </h:outputText>
                        
                        <h:outputText id="TaxText" value="Tax:" />
                        <h:outputText id="TaxValue" value="#{order.tax}">
                            <f:convertNumber type="currency" currencySymbol="$" />
                        </h:outputText>
                        
                        <h:outputText id="TotalAmountText" value="Total Amount:" />
                        <h:outputText id="TotalAmountValue" value="#{order.totalAmount}">
                            <f:convertNumber type="currency" currencySymbol="$" />
                        </h:outputText>
                        
                        <h:outputText id="TrackingNumberText" value="Tracking number:" />
                        <h:panelGroup id="TrackingNumberPanel">
                            <!-- required, min length=4 -->
                            <h:inputText id="trackingNumber" value="#{ship.track}" required="true"/> 

                            <h:message id="message" for="trackingNumber" styleClass="cntError" />
                        </h:panelGroup>
                    </h:panelGrid>
                    
                    <div class="cntInfo">
                        <h:dataTable id="OrderLinesDataTable"
                                     value="#{order.orderLines}" 
                                     var="item"
                                     styleClass="dvdtable" 
                                     headerClass="dvdtablehead"
                                     rowClasses="dvdtableodd,dvdtableeven"
                                     columnClasses="dvdtablecol">
                            <h:column id="quantityColumn">
                                <f:facet name="header">
                                    <h:outputText id="QuantityText" value="#{messages.cartQuantityColumn}" />
                                </f:facet>
                                <h:outputText id="QuantityValue" value="#{item.quantity}"/>
                            </h:column>                        
                            <h:column id="titleColumn">
                                <f:facet name="header">
                                    <h:outputText id="TitleText" value="#{messages.cartTitleColumn}" />
                                </f:facet>
                                <h:outputText id="TitleValue" value="#{item.product.title}" />
                            </h:column>                        
                            <h:column id="actorColumn">
                                <f:facet name="header">
                                    <h:outputText id="ActorText" value="#{messages.cartActorColumn}" />
                                </f:facet>
                                <h:outputText id="ActorValue" value="#{item.product.actors[0].name}" />
                            </h:column>                        
                            
                            <h:column id="priceColumn">
                                <f:facet name="header">
                                    <h:outputText id="PriceText" value="#{messages.cartPriceColumn}" />
                                </f:facet>
                                <h:outputText id="PriceValue" value="#{item.product.price}">
                                    <f:convertNumber type="currency" currencySymbol="$" />
                                </h:outputText>
                            </h:column>                        
                        </h:dataTable>
                    </div>
                    <h:commandButton id="ShipButton" action="#{ship.ship}" value="Ship" /> 
                </h:form>
            </div>
        </ui:define>
    </ui:composition>
</body>
</html>




